package com.dhecp.project.purchase.service;

import java.util.List;
import java.util.Map;

import com.dhecp.common.core.domain.AjaxResult;
import com.dhecp.project.common.service.BaseModuleService;
import com.dhecp.project.purchase.domain.PurchasePlan;
import com.dhecp.project.purchase.domain.PurchasePlanSon;

public interface PurchasePlanService extends BaseModuleService {


    /**
     *@Description: 查询前一单NID、BID
     *@Param: nid 必要参数：当前 单据编码
     *@return: AjaxResult (data.nid 前一单NID， data.bid 前一单BID)
     *@Author: hlf
     *@date: 2022-05-09 9:35
     */
    AjaxResult queryLastNid(Map<String, Object> params) throws Exception;

    /**
     *@Description: 查询后一单NID、BID
     *@Param: nid 必要参数：当前 单据编码
     *@return: AjaxResult (data.nid 后一单NID， data.bid 后一单BID)
     *@Author: hlf
     *@date: 2022-05-09 9:40
     */
    AjaxResult queryNextNid(Map<String, Object> params) throws Exception;

    /**
    *@Description: 查询指定单nid的首记录
    *@Param: [params]
    *@return: com.dhecp.project.purchase.domain.PurchasePlan
    *@Author: hlf
    *@date: 2022-08-15 15:41
    */
    PurchasePlan queryFirstRecord(Map<String, Object> params) throws Exception;

    /**
    *@Description: 查询
    *@Param: [params]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchasePlan>
    *@Author: hlf
    *@date: 2022-08-15 15:41
    */
    List<PurchasePlan> queryList(Map<String, Object> params) throws Exception;
    /**
    *@Description: 获取未生成订单的计划
    *@Param: [params]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchasePlan>
    *@Author: hlf
    *@date: 2023-01-03 9:55
    */
    List<PurchasePlan> queryList2(Map<String, Object> params) throws Exception;

    List<PurchasePlanSon> querySonListBm(Map<String, Object> params) throws Exception;
    List<PurchasePlanSon> querySonListNid(String fNid) throws Exception;

    /**
    *@Description: 查询整单
    *@Param: [params]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchasePlan>
    *@Author: hlf
    *@date: 2022-08-15 15:41
    */
    List<PurchasePlan> queryGroupList(Map<String, Object> params) throws Exception;
    
    /**
    *@Description: 查询指定单nid的整单录
    *@Param: [params]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchasePlan>
    *@Author: hlf
    *@date: 2022-08-15 15:47
    */
    List<PurchasePlan> queryListByNid(Map<String, Object> params) throws Exception;


    /**
     *@Description: 获取已选中的母件商品
     *@Param: code
     *@return: java.util.List<com.dhecp.project.business.domain.ProductBasis>
     *@Author: hlf
     *@date: 2022-08-19 9:00
     */
    List<PurchasePlan> querySelectList(Map<String, Object> params) throws Exception;

    /**
     *@Description: 获取已选中的计划
     *@Param: code
     *@return: java.util.List<com.dhecp.project.business.domain.ProductBasis>
     *@Author: hlf
     *@date: 2022-08-19 9:00
     */
    List<PurchasePlan> querySelectList2(Map<String, Object> params) throws Exception;

    /**
    *@Description: 根据母件获取之间
    *@Param: [params]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchasePlanSon>
    *@Author: hlf
    *@date: 2022-08-20 14:46
    */
    List<PurchasePlanSon> querySonListByFBm(Map<String, Object> params) throws Exception;
    List<PurchasePlanSon> querySonListByFBm2(Map<String, Object> params) throws Exception;


    /**
    *@Description: 保存
    *@Param: [params]
    *@return: com.dhecp.common.core.domain.AjaxResult
    *@Author: hlf
    *@date: 2022-08-15 15:41
    */
    AjaxResult saveData(Map<String, Object> params);

    /**
    *@Description: 修改审核状态
    *@Param: guid 唯一标识
    *@return: com.dhecp.common.core.domain.AjaxResult
    *@Author: hlf
    *@date: 2022-08-17 14:56
    */
    AjaxResult updateType(Map<String, Object> params);
    
    
    /**
    *@Description: 生成采购订单
    *@Param: [params]
    *@return: com.dhecp.common.core.domain.AjaxResult
    *@Author: hlf
    *@date: 2022-09-02 14:35
    */
    AjaxResult updateOrder(Map<String, Object> params) throws Exception ;

    /**
    *@Description: 删除采购数据
    *@Param: guid 唯一标识
    *@return: com.dhecp.common.core.domain.AjaxResult
    *@Author: hlf
    *@date: 2022-08-17 14:56
    */
    AjaxResult delete (Map<String, Object> params);

    /**
     *@Description: 流转  —— 添加流程任务、修改流程状态及生效标志
     *@Param: infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: infoItems 必要参数：对应实体类的json格式字符串（仅需 guid）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:42
     */
    AjaxResult updateFlowGo(Map<String, Object> params);

    /**
     *@Description: 退回  —— 添加流程任务、修改流程状态及生效标志
     *@Param: infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: infoItems 必要参数：对应实体类的json格式字符串（仅需 guid）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:44
     */
    AjaxResult updateFlowBack(Map<String, Object> params);
}
